#include "StdAfx.h"
#include "myIDirect3DVertexBuffer9.h"

SWEGL_DXWRAPPER_IMPLEMENT_IUNKNOWN(myIDirect3DIndexBuffer9, IDirect3DVertexBuffer9);

myIDirect3DIndexBuffer9::myIDirect3DIndexBuffer9(swegl::IndexBuffer *ib) : m_ib(ib)
{
	SWEGL_DXWRAPPER_INIT_IUNKNOWN();
}

myIDirect3DIndexBuffer9::~myIDirect3DIndexBuffer9()
{
}

HRESULT myIDirect3DIndexBuffer9::GetDevice(IDirect3DDevice9** ppDevice)
{
    return E_NOTIMPL;
}

HRESULT myIDirect3DIndexBuffer9::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags)
{
    return E_NOTIMPL;
}

HRESULT myIDirect3DIndexBuffer9::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData)
{
    return E_NOTIMPL;
}

HRESULT myIDirect3DIndexBuffer9::FreePrivateData(REFGUID refguid)
{
    return E_NOTIMPL;
}

DWORD myIDirect3DIndexBuffer9::SetPriority(DWORD PriorityNew)
{
    return E_NOTIMPL;
}

DWORD myIDirect3DIndexBuffer9::GetPriority()
{
    return E_NOTIMPL;
}

void myIDirect3DIndexBuffer9::PreLoad()
{
    
}

D3DRESOURCETYPE myIDirect3DIndexBuffer9::GetType()
{
    return D3DRTYPE_VERTEXBUFFER;
}

HRESULT myIDirect3DIndexBuffer9::Lock(UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags)
{
	*ppbData = m_ib->data<uint8>() + OffsetToLock;
    return S_OK;
}

HRESULT myIDirect3DIndexBuffer9::Unlock()
{
    return S_OK;
}

HRESULT myIDirect3DIndexBuffer9::GetDesc(D3DINDEXBUFFER_DESC *pDesc)
{
    return E_NOTIMPL;
}

